import { join } from "path";
import { APIContext, createAuthHelper, LoginUser } from "f2e-server3"

let docDir = join(process.cwd(), './.f2e_cache/docs');

export const getDocDir = () => docDir;
export const setDocDir = (dir: string) => docDir = dir;


export const getLoginUser = (ctx: APIContext) => {
    const info = createAuthHelper().getLoginUser(ctx)
    return info?.user as LoginUser
}
